#ifndef GHOSTBOARDITEMS_H
#define GHOSTBOARDITEMS_H

#include "gameboarditem.h"
#include "gs.h"

using namespace gs;

namespace gs
{
class GhostSlotGhostItem : public GameBoardItem
{
    Q_OBJECT
public:
    GhostSlotGhostItem(GameBoardOrganizer*, GameBoardItem*);
    QRectF boundingRect() const;
    void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget);
    void setGhost(Ghost*);
    Ghost* getGhost(){return _ghostData;}
    QPixmap getGhostPixmap(){return _ghost;}
    const static int SLOT_WIDTH = 50;
    const static int SLOT_HEIGHT = 100;
protected:
    QPixmap _ghost;
    Ghost* _ghostData;
    GameParAnimation* showAnim;
    GameParAnimation* hideAnim;
};



class GhostSlot : public GameBoardItem
{
    Q_OBJECT
public:
    GhostSlot(GameBoardOrganizer*);
    QRectF boundingRect() const;
    void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget);
    const static int WIDTH = 80;
    const static int HEIGHT = 120;
    const static int SLOT_WIDTH = 50;
    const static int SLOT_HEIGHT = 100;
    void createAnim();
    void setGhostCard(Ghost*);
    void removeGhostCard();
    Ghost* getGhostData();
    void haunt();
    int getSlotIndex();
    int getBoardIndex();
    TileBoard* getTileBoard();
protected:
    void mousePressEvent(QGraphicsSceneMouseEvent *event);
    void hoverEnterEvent(QGraphicsSceneHoverEvent *event);
    void hoverLeaveEvent(QGraphicsSceneHoverEvent *event);
    GhostSlotGhostItem* _ghost;
    GameSeqAnimation* b_anim;
    QPixmap _bg;
    QPixmap _frame;
signals:
    void clicked(GhostSlot*);
};


class PlayerHeadArea : public GameBoardItem
{
public:
    PlayerHeadArea(GameBoardOrganizer*);
    QRectF boundingRect() const;
    void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget);
    const static int WIDTH = GhostSlot::HEIGHT;
    const static int HEIGHT = GhostSlot::SLOT_HEIGHT;
    void createHeadForBoard(GSColor, int);
    QPixmap _head;
    QPixmap _qi;
    QPixmap _frame;
};


class GhostBoardBottom : public GameBoardItem
{
public:
    GhostBoardBottom(GameBoardOrganizer *);
    QRectF boundingRect() const;
    void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget);
    void createBoardBottom(GSColor);
    const static int WIDTH = GhostSlot::WIDTH*3 + GhostSlot::HEIGHT;
    const static int HEIGHT =  GhostSlot::HEIGHT;
    QPixmap _bg;
};

class GhostBoardTop : public GameBoardItem
{
public:
    GhostBoardTop(GameBoardOrganizer *);
    QRectF boundingRect() const;
    void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget);
    const static int WIDTH = GhostSlot::WIDTH*3 + GhostSlot::HEIGHT;
    const static int HEIGHT =  GhostSlot::HEIGHT;
    QPixmap _frame;
};
}
#endif // GHOSTBOARDITEMS_H
